// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'ProductTaskId',
        footer: "Foots",
        cnName: '生产任务',
        name: 'ProductTask',
        newTabEdit: false,
        url: "/ProductTask/",
        sortName: "ProductTaskId"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"BillNo":"","ProductPlanNo":"","BillDate":"","ExigenceId":"","MaterialNo":"","MaterialName":"","Spec":"","MaterialTypeId":"","BomNo":"","UnitId":"","PlanQty":"","DepartmentId":[],"CustomerId":"","BeginDate":"","CompleteDate":"","TechnologicalProcessNo":"","BillType":"","Remark":""};
    const editFormOptions = [[{"title":"任务编号","field":"BillNo","disabled":true,"type":"text"},
                               {"title":"生产计划编号","field":"ProductPlanNo","disabled":true,"type":"text"},
                               {"title":"单据日期","required":true,"field":"BillDate","type":"date"},
                               {"dataKey":"是否","data":[],"title":"紧急状态","required":true,"field":"ExigenceId","type":"select"}],
                              [{"title":"产品编码","required":true,"field":"MaterialNo","type":"text"},
                               {"title":"产品名称","required":true,"field":"MaterialName","disabled":true,"type":"text"},
                               {"title":"规格","field":"Spec","disabled":true,"type":"text"},
                               {"dataKey":"物料属性","data":[],"title":"产品类型","required":true,"field":"MaterialTypeId","disabled":true,"type":"select"}],
                              [{"title":"Bom编号","field":"BomNo","type":"text"},
                               {"dataKey":"计量单位","data":[],"title":"单位","required":true,"field":"UnitId","disabled":true,"type":"select"},
                               {"title":"计划数量","required":true,"field":"PlanQty","type":"decimal"},
                               {"dataKey":"部门级联","data":[],"title":"部门","required":true,"field":"DepartmentId","type":"cascader"}],
                              [{"dataKey":"客户档案","data":[],"title":"客户","field":"CustomerId","type":"select"},
                               {"title":"预计开工日期","required":true,"field":"BeginDate","type":"date"},
                               {"title":"预计完工日期","required":true,"field":"CompleteDate","type":"date"},
                               {"title":"生产工艺编码","field":"TechnologicalProcessNo","type":"text"}],
                              [{"dataKey":"生产任务单据类型","data":[],"title":"单据类型","required":true,"field":"BillType","disabled":true,"type":"select"},
                               {"title":"备注","field":"Remark","colSize":12,"type":"text"}]];
    const searchFormFields = {"BillNo":"","ProductPlanNo":"","BillDate":""};
    const searchFormOptions = [[{"title":"任务编号","field":"BillNo","type":"like"},{"title":"生产计划编号","field":"ProductPlanNo","type":"like"},{"title":"单据日期","field":"BillDate","type":"date"}]];
    const columns = [{field:'ProductTaskId',title:'生产任务标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductPlanDetailId',title:'生产计划明细标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'ParentTaskId',title:'父任务标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'ParentTaskNo',title:'父任务编号',type:'string',width:120,align:'left'},
                       {field:'BillNo',title:'任务编号',type:'string',link:true,width:110,readonly:true,align:'left'},
                       {field:'ProductPlanNo',title:'生产计划编号',type:'string',width:110,readonly:true,align:'left'},
                       {field:'BillDate',title:'单据日期',type:'datetime',width:110,require:true,align:'left'},
                       {field:'ExigenceId',title:'紧急状态',type:'int',bind:{ key:'是否',data:[]},width:110,require:true,align:'left'},
                       {field:'MaterialId',title:'产品标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'MaterialNo',title:'产品编码',type:'string',width:110,require:true,align:'left'},
                       {field:'MaterialName',title:'产品名称',type:'string',width:110,readonly:true,require:true,align:'left'},
                       {field:'Spec',title:'规格',type:'string',width:110,readonly:true,align:'left'},
                       {field:'MaterialTypeId',title:'产品类型',type:'int',bind:{ key:'物料属性',data:[]},width:110,readonly:true,require:true,align:'left'},
                       {field:'BomId',title:'Bom标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'BomNo',title:'Bom编号',type:'string',width:110,align:'left'},
                       {field:'UnitId',title:'单位',type:'int',bind:{ key:'计量单位',data:[]},width:110,readonly:true,require:true,align:'left'},
                       {field:'PlanQty',title:'计划数量',type:'decimal',width:110,require:true,align:'left'},
                       {field:'StockInQty',title:'入库数量',type:'decimal',width:110,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,require:true,align:'left'},
                       {field:'CustomerId',title:'客户',type:'int',bind:{ key:'客户档案',data:[]},width:110,align:'left'},
                       {field:'BeginDate',title:'预计开工日期',type:'datetime',width:110,require:true,align:'left'},
                       {field:'CompleteDate',title:'预计完工日期',type:'datetime',width:110,require:true,align:'left'},
                       {field:'CompleteStatusId',title:'完工状态',type:'int',bind:{ key:'是否',data:[]},width:110,require:true,align:'left'},
                       {field:'ClosureStatusId',title:'结案状态',type:'int',bind:{ key:'结案状态',data:[]},width:110,require:true,align:'left'},
                       {field:'TechnologicalProcessId',title:'生产工艺',type:'int',width:110,align:'left'},
                       {field:'TechnologicalProcessNo',title:'生产工艺编码',type:'string',width:120,align:'left'},
                       {field:'BillType',title:'单据类型',type:'int',bind:{ key:'生产任务单据类型',data:[]},width:80,readonly:true,require:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:110,align:'left'},
                       {field:'CreateID',title:'创建人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人名称',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:110,align:'left'},
                       {field:'ModifyID',title:'修改人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人名称',type:'string',width:100,align:'left'},
                       {field:'ModifyDate',title:'修改日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditDate',title:'审核日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'AuditId',title:'审核人标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人',type:'string',width:120,align:'left'},
                       {field:'IsCreateMaterialList',title:'是否创建用量清单',type:'int',bind:{ key:'是否',data:[]},width:80,align:'left'}];
    const detail ={columns:[]};
    const details = [  { 
                    cnName: '生产工艺',
                    table: 'ProductTaskProcess',
                    columns: [{field:'ProductTaskProcessId',title:'生产任务工序标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'ProductProcessId',title:'工序标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'ProcessCode',title:'工序编码',type:'string',width:110,edit:{type:'text'},require:true,align:'left'},
                       {field:'ProcessSeq',title:'工序序号',type:'int',width:110,edit:{type:'number'},require:true,align:'left'},
                       {field:'ProcessName',title:'工序名称',type:'string',width:110,readonly:true,edit:{type:'text'},require:true,align:'left'},
                       {field:'ProcessTypeId',title:'工序类型',type:'int',bind:{ key:'工序类型',data:[]},width:110,readonly:true,edit:{type:'select'},require:true,align:'left'},
                       {field:'IsLasted',title:'是否末道工序',type:'int',bind:{ key:'是否',data:[]},width:80,require:true,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,edit:{type:'cascader'},require:true,align:'left'},
                       {field:'IsDipathc',title:'启用派工',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'IsOutSource',title:'是否委托',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'SupplyId',title:'委托供应商',type:'int',bind:{ key:'供应商档案',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'ReportWorkTypeId',title:'报工方式',type:'int',bind:{ key:'报工方式',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'DeviceId',title:'生产设备',type:'int',bind:{ key:'设备档案下拉table',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'ProductionGroupId',title:'班组',type:'int',bind:{ key:'班组信息',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'WorkerId',title:'作业人员',type:'int',bind:{ key:'职员',data:[]},width:110,edit:{type:'selectList'},align:'left'},
                       {field:'ProductTaskId',title:'生产任务标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'ProductNoticeId',title:'生产通知单标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'ProductNoticeNo',title:'生产通知单编号',type:'string',width:120,hidden:true,edit:{type:'text'},align:'left'},
                       {field:'IsChecked',title:'是否质检',type:'int',bind:{ key:'是否',data:[]},width:80,edit:{type:'select'},require:true,align:'left'},
                       {field:'WorkHourPrice',title:'计时单价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'WorkQtyPrice',title:'计件单价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'PriceTypeId',title:'计价方式',type:'int',bind:{ key:'计价方式',data:[]},width:80,require:true,align:'left'}],
                    sortName: 'ProcessSeq',
                    key: 'ProductTaskProcessId',
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            },                    { 
                    cnName: '用料清单',
                    table: 'ProductMaterialList',
                    columns: [{field:'ProductMaterialListId',title:'用料清单标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductTaskId',title:'生产任务标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'MaterialId',title:'物料标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'MaterialNo',title:'物料编码',type:'string',width:120,edit:{type:'text'},require:true,align:'left'},
                       {field:'MaterialName',title:'物料名称',type:'string',width:120,edit:{type:'text'},require:true,align:'left'},
                       {field:'Spec',title:'规格',type:'string',width:120,edit:{type:'text'},align:'left'},
                       {field:'MaterialTypeId',title:'物料属性',type:'int',bind:{ key:'物料属性',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'UnitId',title:'单位',type:'int',bind:{ key:'计量单位',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'IsBackflush',title:'是否倒冲',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'NextBomId',title:'子Bom标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'NextBomNo',title:'子Bom编码',type:'string',width:120,edit:{type:'text'},align:'left'},
                       {field:'IsCriticalParts',title:'关键件',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'ProductProcessId',title:'所属工序',type:'int',bind:{ key:'工序信息',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'AttritionRate',title:'损耗率',type:'decimal',width:110,edit:{type:'decimal'},require:true,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,edit:{type:'cascader'},require:true,align:'left'},
                       {field:'FeedingQty',title:'上料数量',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'UseMaterialQty',title:'用料数量',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'UnitQty',title:'单位用量',type:'decimal',width:110,align:'left'}],
                    sortName: 'ProductMaterialListId',
                    key: 'ProductMaterialListId',
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            }];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}